home *** CD-ROM | disk | FTP | other *** search
- global DBPath
-
- on exitFrame me
- adb = DGOpenDatabase(DBPath & "FlyBox.mdb", 0, 0, ";PWD=StopLooking")
- theString = getVariable(sprite(1), "Search")
- num = length(theString)
- repeat with i = 1 to num
- if theString.char[i] = "'" then
- NewString = NewString & "''"
- next repeat
- end if
- NewString = NewString & theString.char[i]
- end repeat
- qd = DGQDOpen("GetFlySearch", adb)
- DGQDSetParameterValue("SearchStr", NewString, qd)
- rs = DGQDCreateRS(qd)
- a = 0
- repeat while not DGRSisEOF(rs)
- setVariable(sprite(1), "Result" & a & "_FlyID", DGRSGetFieldValue("FlyID", rs) & EMPTY)
- setVariable(sprite(1), "Result" & a & "_Picture", DGRSGetFieldValue("Picture", rs))
- setVariable(sprite(1), "Result" & a & "_FlyName", DGRSGetFieldValue("FlyName", rs))
- setVariable(sprite(1), "Result" & a & "_Descript", DGRSGetFieldValue("Descript", rs))
- DGRSmoveNext(rs)
- a = a + 1
- end repeat
- Results = getVariable(sprite(1), "Results")
- Results = Results.integer
- setVariable(sprite(1), "Results", a & EMPTY)
- repeat while a < Results
- setVariable(sprite(1), "Result" & a & "_FlyID", EMPTY)
- setVariable(sprite(1), "Result" & a & "_Picture", EMPTY)
- setVariable(sprite(1), "Result" & a & "_FlyName", EMPTY)
- setVariable(sprite(1), "Result" & a & "_Descript", EMPTY)
- a = a + 1
- end repeat
- if DGQDIsOpen(qd) then
- DGQDClose(qd)
- end if
- DGRSClose(rs)
- DGClose(adb)
- sprite(1).goToFrame("Results")
- go("Finished")
- end
-